<?php
/**
 * Created by PhpStorm.
 * User: yuethink
 * Date: 2018/10/14
 * Time: 14:37
 */

namespace App\Http\Controllers\Api;


class TestController
{
    public function index()
    {
       return strtotime(date('Y-m-d'));
    }
    protected function combine($arr, $m, $isRepeat = 0, $b = [], $n = 0, $res = []) {
        !$n && $n = $m;

        if($m == 1) {
            foreach($arr as $item)
                $res[] = array_merge($b, [$item]);
        } else {
            foreach($arr as $key => $item) {
                $b[$n - $m] = $item;

                $tmp = $arr;
                if(!$isRepeat) unset($tmp[$key]);

                $res = self::combine($tmp, $m-1, $isRepeat, $b, $n, $res);
            }
        }

        return $res;
    }
}